package com.atung.provider;

import java.util.Objects;

import org.apache.ibatis.jdbc.SQL;

import com.atung.model.BusBoardingRecord;

public class BusBoardingRecordProvider {

	
	public String saveBusBoardingRecordProvider(BusBoardingRecord busBoardingRecord){
		
		return new SQL(){
			{
				INSERT_INTO("bus_boarding_record");
				VALUES("id", "#{id}");
				VALUES("city", "#{city}");
				VALUES("pick_up_point", "#{pickUpPoint}");
				VALUES("drop_off_point", "#{dropOffPoint}");
				VALUES("contact_name", "#{contactName}");
				VALUES("contact_phone", "#{contactPhone}");
				VALUES("departure_time", "#{departureTime}");
				if(Objects.nonNull(busBoardingRecord.getIsDelect())){
					VALUES("is_delect", "#{isDelect}");
				}
				VALUES("creation_time", "#{creationTime}");
				VALUES("modification_time", "#{modificationTime}");
			}
		}.toString();
	}
}
